package com.bojiu.lawsearch.lawsearch.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author: afdiao
 * @Date：2020/3/5 22:44
 * @Description:
 */
@ApiModel(value = "上传基础信息", description = "法律规制的基本信息，excel里面为具体条例")
@Table(name = "mst_title")
@Data
public class LawBaseInfo {

    @ApiModelProperty(value = "id", required = false)
    @Column(name = "id")
    private Integer id;

    @ApiModelProperty(value = "文件编号",required = true)
    @NotNull(message = "文件编号不能为空")
    @Column(name = "serial_number")
    private String serial_number;

    @ApiModelProperty(value = "标题",required = true)
    @NotNull(message = "标题不能为空")
    @Column(name = "title")
    private String title;

    /**
     * 0 法律  1规范
     */
    @ApiModelProperty(value = "文件类型，0表示法律 ，1表示规范",required = true)
    @NotNull(message = "文件类型不能为空")
    @Column(name = "type")
    private Integer type;

    /**
     * 类别中文名
     */
    @Transient
    private String typeName;

    @ApiModelProperty(value = "适用范围，省份,选择全国的话传all")
    @NotNull(message = "省不能为空")
    @Column(name = "province")
    private String province;

    @ApiModelProperty(value = "省份id")
    @Column(name = "provinceId")
    private Integer provinceId;

    @ApiModelProperty(value = "适用范围市，选择全国的话传all")
    @NotNull(message = "市不能为空")
    @Column(name = "city")
    private String city;

    @ApiModelProperty(value = "城市id")
    @Column(name = "cityId")
    private Integer cityId;

    /**
     * 行业
     */
    @ApiModelProperty(value = "行业，法律可不选，规范必传",required = false)
    @Column(name = "profession_id")
    private Integer profession_id;

    /**
     * 行业名称
     */
    @Transient
    private String professionName;

    /**
     * 发布部门
     */
    @ApiModelProperty(value = "发布部门",required = false)
    @Column(name = "publish_apartment")
    private String publish_apartment;

    @ApiModelProperty(value = "发布时间",required = false)
    @Column(name = "publish_time")
    private String publish_time;

    /**
     * 上传的pdf
     */
    @ApiModelProperty(value = "上传pdf返回的存储名",required = false)
    @Column(name = "pdfFileName")
    private String pdfFileName;

    /**
     * 上传的excel
     */
    @ApiModelProperty(value = "上传word解析后的excel的存储名",required = false)
    @Transient
    private String excelName;

    /**
     * 施行时间
     */
    @ApiModelProperty(value = "施行时间",required = false)
    @Column(name = "implement_time")
    private String implement_time;

    /**
     * 删除状态
     * 0 非删除  1 删除
     */
    @Column(name = "is_deleted")
    private Integer is_deleted;

    /**
     * 大标题点击量
     */
    @Column(name = "click_count")
    private Integer clickCount;

    @ApiModelProperty(value = "大标题下关联的条例集合",required = true)
    @Transient
    private List<Rule> rules;

    /**
     * 用于计算得分，查询排名
     */
    @Transient
    private double score;

    @ApiModelProperty(value = "查询关联到的条例数目",required = false)
    @Transient
    private Integer relationNum;
}
